//引入项目中全部的全局组件
import SvgIcon from './SvgIcon/index.vue'
import Pagination from './Pagination/index.vue'
import Category from './Category/index.vue'
//引入element-plus的全部图形组件
import * as ElementPlusIconsVue from '@element-plus/icons-vue'

//全局对象
const allGloblComponent: any = { SvgIcon, Pagination, Category }
// import type { App, Component } from 'vue';
// const components: { [name: string]: Component } = { SvgIcon };
export default {
  install(app: any) {
    Object.keys(allGloblComponent).forEach((key) => {
      app.component(key, allGloblComponent[key])
    })
    for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
      app.component(key, component)
    }
  },
  // install(app: App) {
  //     Object.keys(components).forEach((key: string) => {
  //         app.component(key, components[key]);
  //     })
  // }
}
